USE [OHNEW]
GO

/****** Object:  Table [dbo].[P_Batch]    Script Date: 01/23/2013 19:43:43 ******/
SET ANSI_NULLS ON
GO

SET QUOTED_IDENTIFIER ON
GO

SET ANSI_PADDING ON
GO

CREATE TABLE [dbo].[P_Batch](
	[ID] [uniqueidentifier] NOT NULL,
	[Code] [varchar](50) NOT NULL,
	[Vendor] [uniqueidentifier] NOT NULL,
	[PD] [datetime] NOT NULL,
	[ExpDate] [datetime] NOT NULL,
	[Price] [dbo].[udtJE] NOT NULL,
	[WithCOA][int] NOT NULL default 0,
	[Disable] [int] NOT NULL,
	[Material] [uniqueidentifier] NULL,
 CONSTRAINT [PK_P_Batch] PRIMARY KEY CLUSTERED 
(
	[ID] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]

GO

SET ANSI_PADDING OFF
GO

ALTER TABLE [dbo].[P_Batch] ADD  CONSTRAINT [DF__P_Batch__ID__793DFFAF]  DEFAULT (newid()) FOR [ID]
GO

ALTER TABLE [dbo].[P_Batch] ADD  DEFAULT ((0)) FOR [Price]
GO

ALTER TABLE [dbo].[P_Batch] ADD  CONSTRAINT [DF_P_Batch_Disable]  DEFAULT ((0)) FOR [Disable]
GO


